﻿<%@ Page Title="manage all products in warehouse " Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="manage_product.aspx.cs" Inherits="NKD07.Admin.manage_product" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    <asp:Panel runat="server" Width="100%" HorizontalAlign="Left">
        <asp:Panel runat="server" Width="15%"  style="float:left; margin-left:5%">
            <asp:Label ID="ten" runat="server" Text="CATEGORIES LIST" Width="100%" Font-Size="Large"></asp:Label>
            <asp:Panel runat="server" width="100%" HorizontalAlign="Center" style="margin-top:20px">
                <asp:DataList ID="dlCaregories" runat="server" Width="100%" BackColor="White" 
                    BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="10" 
                    ForeColor="Black" GridLines="Horizontal" CellSpacing="10">
                    <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                    <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                    <ItemTemplate>
                        <asp:Panel ID="Panel1" runat="server" HorizontalAlign="Left" Width="100%" style="padding:10px 0px 10px 0px">
                            <asp:HyperLink ID="hplCategory" runat="server" Font-Bold="True" 
                                Text='<%# Eval("name") %>' NavigateUrl='<%# this.ResolveUrl("manage_product.aspx?categoryID=" + String.Format("{0}",Eval("id")))%>' Font-Underline="False">
                            </asp:HyperLink>
                        </asp:Panel>
                    </ItemTemplate>
                    <SelectedItemStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                </asp:DataList>
            </asp:Panel>
        </asp:Panel>
        
        <asp:Panel runat="server" Width="74%" HorizontalAlign="Left" style="float:left; margin-left:50px;">
            <asp:Label ID="Label1" runat="server" Text="PRODUCTS LIST" Width="100%" Font-Size="Large"></asp:Label>
            <asp:Panel runat="server" HorizontalAlign="Right" Font-Bold="true">
                <asp:HyperLink runat="server" NavigateUrl="~/Admin/insert_product.aspx" Text="Insert new product"></asp:HyperLink>
            </asp:Panel>
            <asp:GridView ID="gvProducts" runat="server" Width="100%" BackColor="White" 
                BorderColor="#FF6600" BorderStyle="Outset" BorderWidth="2px" CellPadding="4" 
                EnableModelValidation="True" AutoGenerateColumns="False" 
                style="margin-top:20px" AllowPaging="True" 
                EmptyDataText="the list is empty... please select a category on the left!" 
                HorizontalAlign="Center" PageSize="15" 
                onrowdatabound="gvProducts_RowDataBound" 
                onrowdeleting="gvProducts_RowDeleting" DataKeyNames="id" 
                onrowediting="gvProducts_RowEditing" ForeColor="Black">
                <AlternatingRowStyle HorizontalAlign="Center" />
                <Columns>
                    <asp:TemplateField HeaderText="Index">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text="<%# Container.DataItemIndex+1 %>"></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" Width="50px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="id" HeaderText="ID" Visible="False" />
                    <asp:BoundField DataField="name" HeaderText="Name" >
                    <HeaderStyle HorizontalAlign="Center" Width="200px" />
                    <ItemStyle Width="200px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="description" 
                        HeaderText="Description">
                    <HeaderStyle Width="300px" HorizontalAlign="Center" />
                    <ItemStyle Width="300px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="stock" HeaderText="Stock" />
                    <asp:BoundField DataField="priceSell" 
                        HeaderText="Price Sell" />
                    <asp:BoundField DataField="dateAdded" 
                        HeaderText="Date Added" DataFormatString="{0:dd/MM/yyyy}" >
                    <HeaderStyle Width="100px" />
                    <ItemStyle Width="100px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Mapping" HeaderText="Mapping" />
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:ImageButton ID="imgbtnDelete" runat="server" Height="20px" 
                                ImageAlign="Middle" ImageUrl="~/images/delete_icon.png" Width="20px" 
                                CommandName="delete" />
                        </ItemTemplate>
                        <ItemStyle VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Edit">
                        <ItemTemplate>
                            <asp:ImageButton ID="ImageButton1" runat="server" 
                                ImageUrl="~/images/edit_icon.png" CommandName="edit" />
                        </ItemTemplate>
                        <ItemStyle VerticalAlign="Middle" />
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle HorizontalAlign="Center" />
                <EmptyDataRowStyle HorizontalAlign="Center" />
                <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                <HeaderStyle BackColor="Gray" Font-Bold="True" ForeColor="White" 
                    HorizontalAlign="Center" />
                <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                <RowStyle BackColor="White" ForeColor="#330099" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" 
                    HorizontalAlign="Center" />
            </asp:GridView>
        </asp:Panel>
    </asp:Panel>
        
</asp:Content>
